using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace OpenWeb.Dal.Models
{
      
    public class Contact : OpenWeb.Dal.Interfaces.IContacts
    {
        public Contact()
        {
            //this.Reminders = new HashSet<Reminder>();
            //this.Adresses = new HashSet<Address>();
            ////this.ContactProspect = new ContactProspect();
        }

        #region Primitive Properties

        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]     
        [Required]
        public virtual int ID
        {
          get;
          set;
        }
        //[Required]
        public virtual Nullable<bool> IsCustomer
        {
          get;
          set;
        }
        //[Required]
        public virtual Nullable<bool> IsPerson
        {
          get;
          set;
        }
        //[Required]
        public virtual Nullable<int> ContactType
        {
          get;
          set;
        }
        //[Required]
        [MaxLength(6)]
        public virtual string Pref
        {
          get;
          set;
        }

        [Required(ErrorMessageResourceType = typeof(OpenWeb.Res.Resources),ErrorMessageResourceName = "required")]       
        
        [MaxLength(50)]
        public virtual string Name
        {
          get;
          set;
        }
        //[Required]
        [MaxLength(50)]
        public virtual string Surname
        {
          get;
          set;
        }
        //[Required]
        [MaxLength(300)]
        public virtual string Description
        {
          get;
          set;
        }
        //[Required]
        [MaxLength(200)]
        public virtual string Notes
        {
          get;
          set;
        }

        //[RegularExpression(".+@.+\\..+", ErrorMessageResourceType = typeof(MyResources.Resources),
        //    ErrorMessageResourceName = "EmailInvalid")] 
        [MaxLength(50)]
        public virtual string Email
        {
          get;
          set;
        }
        //[Required]
        [MaxLength(20)]
        public virtual string Tel1
        {
          get;
          set;
        }
        //[Required]
        [MaxLength(20)]
        public virtual string Tel2
        {
          get;
          set;
        }
        //[Required]
        [MaxLength(20)]
        public virtual string Cell
        {
          get;
          set;
        }
        //[Required]
        [MaxLength(20)]
        public virtual string Fax
        {
          get;
          set;
        }
        //[Required]
        [MaxLength(50)]
        public virtual string WebSite
        {
          get;
          set;
        }
        //[Required]
        public virtual Nullable<System.DateTime> DateCreation
        {
          get;
          set;
        }
        [Required]
        public virtual System.Guid Guid
        {
          get;
          set;
        }
        //[Required]
        public virtual Nullable<bool> IsDeleted
        {
          get;
          set;
        }

        #endregion
    
        public virtual ContactProfile Profile { get; set; }

        public virtual ICollection<Reminder> Reminders { get; set; }
        public virtual ICollection<Address> Adresses { get; set; }
    }





    //Lista

    //public class ContactsListViewModel : OpenWeb.Dal.Models.IListModel 
    //{
    //  public List<Document> DocumentList { get; set; }
    //  public int TotalItemCount { get; set; }
    //  public int ThisPageItemCount { get; set; }
    //  public int TotalPageCount { get; set; }
    //}


}
